{\rtf1\ansi\ansicpg1252\cocoartf1404\cocoasubrtf470
\cocoascreenfonts1{\fonttbl\f0\fswiss\fcharset0 Helvetica;\f1\fnil\fcharset0 Menlo-Regular;}
{\colortbl;\red255\green255\blue255;\red100\green56\blue32;\red196\green26\blue22;\red92\green38\blue153;
\red43\green131\blue159;\red0\green0\blue255;\red163\green21\blue21;}
\margl1440\margr1440\vieww9000\viewh8400\viewkind0
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0

\f0\fs24 \cf0 \
\
TODO: FIXME: This document is out-of-date as of September, 2016, and should be revised soon.\
\
==================================================================================\
\
\
\pard\pardeftab720\partightenfactor0

\b \cf0 Future plans:\
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0

\b0 \cf0 	More usage of XPath for XML search\
	Handle namespaces properly\
	Handle all units of measurement.  Currently, "px" is recommended.\
	Support external plugins directory in ~/Library/ApplicationSupport/macSVG/Plugins\
	App store support?\
		Mac App Store receipt validation\
\
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0

\b \cf0 Current plugins:
\b0 \
	AnimateMotionElement\
	ColorAttribute\
	CoordinatesAttribute\
	ImageElement\
	PathAttribute\
	PathElement\
	PathElementShapeAnimation\
	SVGAttribute\
	SVGElement\
	TextElement\
	TransformAttribute\
\
\pard\pardeftab720\partightenfactor0

\b \cf0 To-do list:\
\pard\pardeftab720\partightenfactor0

\b0 \cf0 \
	Needed Plugins:\
		AnimateElement\
		AnimateColorElement\
		AnimateMotion\
		AnimateTransformElement\
		ClipPathElement\
		FilterElement\
		MaskElement\
		MarkerElement\
		LinearGradientElement\
		RadialGradientElement\
		PatternElement\
		ScriptElement\
\
	New menu-based Plug-ins\
		Pie chart generator\
		Text clip path and image\
\
	Group items button\
\
	Metadata\
\
	Open files with network connection - http, scp, sftp\
	Save files with network connection - scp, sftp\
	Compress/Decompress svgz\
\
	Possible path element plugin functions:\
		Convert to absolute coordinates - Done\
		Convert to relative coordinates - Done\
		Insert Point\
		Remove Point\
		Extend Path\
		Split path\
		Join paths\
		Flip path - Partial work done\
		Mirror path - Done\
		Reverse path\
		Close path - Done\
\
		Transform path points\
		Transform selected path points\
\
		Scale path coordinates\
		Subdivide path segment\
		Delete path segment\
		Duplicate path\
		Radial duplicate path\
		Multiple endpoint select and move\
\
	Clip-path\
	Use path in AnimateMotion\
	Use path in Text animate - Mostly done\
	Use path in shape morphing animate - Done\
\
\
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
\cf0 \
Revision 5, August 2013\
\
\pard\pardeftab720\partightenfactor0

\b\fs48 \cf0 macSVG Technical Specifications
\b0 \
\pard\pardeftab720\partightenfactor0

\fs24 \cf0 \
macSVG is an OS X application for creating and editing Scalable Vector Graphics (SVG) documents.\'a0 It is useful for general graphic design purposes, and is especially for efficient production of ads for mobile devices.\
\
The XML SVG graphics format is part of the new HTML5 standard for web design, so macSVG files can be viewed on any modern web browser, including mobile devices for iOS and Android.\
\
\pard\pardeftab720\partightenfactor0

\b \cf0 Document model and view:
\b0 \
	SVG document stored in an XML DOM structure as the master copy for editing purposes.\
		The application will automatically enforce the rules for proper XML structure, based on the standard SVG DTD.\
	The structure and content of the SVG file are represented in a hierarchical outline view.\
		Elements can be added and re-arranged in the outline view with mouse dragging operations.\
		Attributes for a selected element are displayed in an editable table view.\
		Plug-in editor modules will assist the user in setting attribute values, e.g., displaying a color wheel to set color values.\
	The image is rendered on-screen with a Cocoa WebView, based on the WebKit rendering engine.\
		The WebView is interactive for drawing and editing graphic elements.\
		The WebView supports the standard WebKit developer tools for Javascript debugging.\
	A timeline view will assist the user in animation scripting.\
		Animation events can be adjusted interactively in the timeline.\
\

\b Drawing tools:
\b0 \
	Rectangle\
	Circle\
	Ellipse\
	Line\
	Polyline\
	Polygon\
	Path, see below\
	Text\
	Images\
\

\b Path functions:
\b0 \
	Moveto\
	Lineto\
	Horizontal lineto\
	Vertical lineto\
	Cubic curves\
	Smooth cubic curves\
	Quadratic curves\
	Smooth quadratic curves\
	Elliptical arcs\
	Freestyle path\
\
\

\b Live preview:
\b0 \
	The frontmost document can be previewed instantly via a desktop web browser, a mobile device web browser, or the iPhone/iPad Simulator.\
	SVG document access examples:\
		http://localhost:8080  (To view on the same Mac running macSVG)\
		http://192.168.1.3:8080 (To view from a remote device, e.g. the iPhone Safari browser.  Substitute the correct IP address for the Mac in the example - but use :8080 as the port number)\
\
\
\
\
\

\b Plug-in Development Process:\
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\partightenfactor0
\cf0 	
\b0   macSVG supports Cocoa plug-in architecture as described in this Apple document:\
\
	  https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/LoadingCode/Concepts/Plugins.html\
\
           A plug-in is a good way to add new features to macSVG, with few or no changes to the main app.  A macSVG plug-in framework is supplied in the project for by plug-ins.  Currently, two kinds of plug-ins are supported in macSVG.  The first kind is displayed as a panel for editing selected elements or attributes.  The second kind of plug-in is available under a Plug-ins menu in the menu bar, and typically opens a dialog window for user input.\
\
            
\b Follow these steps to create a new plug-in module for macSVG:
\b0 \

\b \
\pard\pardeftab720\partightenfactor0

\b0 \cf0 	In XCode, select the "MacSVG Plugin Projects/MacSVG Plugins" folder in the Project navigator, then choose the "New Project" command under the File menu.\
	Create a new MacOS Bundle project by selecting the "Bundle" template in the Framework & Bundle category.  \
	For this example, the plugin project product name is "XyzElementEditor" for an element editor, or "XyzAttributeEditor" for an attribute editor.\
		Company identifier: "com.arkphone"\
		Framework: Cocoa\
	In the new project options, set the Bundle Extension to "plugin".\
	Disable the option to "Create Git repository".  Instead, the Git repository for plugin projects already exists in the main macSVG project, so it will be used instead.\
	Set the "Add to:" popup menu to the "MacSVG" project, and the "Group" popup menu to the "MacSVG Plugin Projects/MacSVG Plugins" folder.  Click the "Create" button to create the plugin project.\
	Plugin projects should be ordered alphabetically by name in the Project navigator, so drag the new plugin project folder to the correct location inside the "MacSVG Plugins" folder.\
	Select the new plugin project folder icon in the Project navigator, and add a new Cocoa Class file as a subclass of MacSVGPlugin, naming the class like "XyzElementEditor" or "XyzAttributeEditor".  Plug-ins can be implemented in Objective-C or Swift languages, but Objective-C is currently used in most plug-ins.\
	In XyzElementEditor.h or XyzAttributeEditor.h, verify or add import directive -
\f1\fs22 \cf2 \CocoaLigature0 \
\pard\tx560\pardeftab560\pardirnatural\partightenfactor0
\cf2 			#import \cf3 <MacSVGPlugin/MacSVGPlugin.h>
\f0\fs24 \cf0 \CocoaLigature1 \
\pard\pardeftab720\partightenfactor0
\cf0 	Create a new empty User Interface NIB file for the plugin view, named like "XyzElementEditor.xib".\
	In Interface Builder, set the NIB File's Owner object to your plugin object, e.g. "XyzElementEditor" or "XyzAttributeEditor".\
	In the NIB's File Inspector, disable the checkbox option setting for "Use Auto-Layout".\
\
	
\b For element or attribute editor plug-ins -
\b0 \
		\
		In the NIB editor, create a new NSView custom view for the plug-in main view (or copy and paste a main view from an existing plugin xib).\
		In the NIB's Size Inspector, set the dimensions for the plug-in's main view for width=270 and height=346, and enable all of the struts and springs for autosizing the view.  (The height can be increased if needed.  The plugin panel view in the main application contains an NSScroller to contain the plugin view.\
		Select File's Owner and use the Connection Inspector to connect the "pluginView" outlet to the main view.\
		In the main code unit (e.g. XyzPlugin.m), implement one of these mandatory methods, and return a string for valid plug-in for the context, or NULL -\
\pard\tx560\pardeftab560\pardirnatural\partightenfactor0

\f1\fs22 \cf0 \CocoaLigature0 				For element editors: - (\cf4 NSString\cf0  *)isEditorForElement:(NSXMLElement *)aElement elementName:(\cf4 NSString\cf0  *)elementName\
				For attribute editors- (\cf4 NSString\cf0  *)isEditorForElement:(NSXMLElement *)aElement elementName:(\cf4 NSString\cf0  *)elementName attribute:(\cf4 NSString\cf0  *)attributeName\
\pard\pardeftab720\partightenfactor0

\f0\fs24 \cf0 \CocoaLigature1 	Add the "Cocoa.framework" to the project navigator items.\
	Add the "MacSVGPlugin.framework" to the project navigator items.\
	Add the file named "macSVGPluginConfig.xcconfig" to the project navigator items.\
	Set "macSVGPluginConfig" in the Project -> Info -> Configurations for Debug and Release targets..\
\
	
\b For menu plug-ins -
\b0 \
\
		Implement  
\f1\fs22 \CocoaLigature0 - (\cf5 NSString\cf0  *)pluginMenuTitle
\f0\fs24 \CocoaLigature1 \
			Should return name of the menu plugin\
		Implement  
\f1\fs22 \CocoaLigature0 - (\cf6 BOOL\cf0 )isMenuPlugIn
\f0\fs24 \CocoaLigature1 \
			Should return YES\
		Implement  
\f1\fs22 \CocoaLigature0 - (\cf6 BOOL\cf0 )beginMenuPlugIn
\f0\fs24 \CocoaLigature1 \
			If needed, in the NIB editor, create a new NSPanel modal window for the plug-in main view\
			Menu plug-ins are responsible for opening and closing their windows.\
		Implement a window controller, if needed.  \
			Typically, a separate window would be used with 
\f1\fs22 \CocoaLigature0 runModalForWindow:
\f0\fs24 \CocoaLigature1 .\
	\
	The plugin is now ready to start using your custom implementation.\
\
	See MacSVGPlugin.h for several other methods that can be overridden to facilitate several editing activities.\
\
	See MacSVGPluginCallbacks.h for several methods that can be called in a plug-in to get or set data in the main app.\
\
	If MacSVGPluginCallbacks.h does not contain an existing method that is needed for the plug-in to use, it may be useful for the plug-in to try direct access into the main application.  In the plugin's Build Settings "HEADER_SEARCH_PATH" to add "$(SRCROOT)/../../../macSVG" with recursive searching.  Then the 
\f1\fs22 \cf6 \CocoaLigature0 #import \cf7 "MacSVGDocumentWindowController.h"
\f0\fs24 \cf0 \CocoaLigature1  directive can be used in your plugin's source code, and include other headers from the main application as needed.\
\
	Several element and attribute editor plugins implement this method to be called from the main application to handle mouse and keyboard events -\
\
\pard\tx560\pardeftab560\pardirnatural\partightenfactor0

\f1\fs22 \cf0 \CocoaLigature0 	-(\cf6 void\cf0 ) handlePluginEvent:(\cf5 DOMEvent\cf0  *)event\
\pard\pardeftab720\partightenfactor0

\f0\fs24 \cf0 \CocoaLigature1 \
	Element editors should return a string in the 
\f1\fs22 \CocoaLigature0 isEditorForElement:elementName:
\f0\fs24 \CocoaLigature1  method, and return null in the 
\f1\fs22 \CocoaLigature0 isEditorForElement:elementName:attribute:
\f0\fs24 \CocoaLigature1  method.\
	Attribute editors should return a string in the 
\f1\fs22 \CocoaLigature0 isEditorForElement:attribute:
\f0\fs24 \CocoaLigature1  method, and return null in the 
\f1\fs22 \CocoaLigature0 isEditorForElement:elementName:
\f0\fs24 \CocoaLigature1  method.\
	Menu plug-in should implement 
\f1\fs22 \CocoaLigature0 isMenuPlugIn
\f0\fs24 \CocoaLigature1 , as noted above.\
\
	To embed the plugin, do an initial build of the plugin, then add the built plugin bundle product to the main app's  file list in the main application's Plugins group, with "Add to targets" not checkmarked.  In the File Inspector, set that copy of the plugin to use the Location "Relative to Build Products".  \
	Finally, add that copy of the plugin to the main application's Build Phases in the "Copy Plugins Files" phase ,where the Destination is set to "Plugins".\
\
	If macSVG is being built with sandboxing and entitlements, the plug-in will also need appropriate settings for code signing.\
\
	\
=================================================================================================\
\
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
\cf0 Old notes about using a custom WebKit framework.  The current version uses the standard WebKit , so not currently relevant -\
\
If linker error about cannot link directly to custom WebKit/WebCore and use WebKit umbrella framework instead, check these things -\
\
In Build Settings -> Linking -> Runpath Search Paths, set - \
	@executable_path/../Frameworks \
	@executable_path/../../../Frameworks\
\
In Build Phase - Copy Files -\
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\partightenfactor0
\cf0 	JavaScriptCore.framework\
	MacSVGPlugin.framework\
	WebKit.framework\
	WebCore.framework\
\
Also, run the installNameTool.sh script- \
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
\cf0 \
#!/bin/bash\
\
# For embedding custom WebKit frameworks in a Mac app\
# usage: install_name_tool -id  [name] file\
# usage: install_name_tool -change [oldPath] [oldPath] file\
# to verify changes, use: otool -L [pathToExecutable]\
\
echo "updating WebKit..."\
\
install_name_tool -id \\\
  @executable_path/../Frameworks/WebKit.framework/Versions/A/WebKit \\\
  ./WebKit/WebKitBuild/Release/WebKit.framework/Versions/A/WebKit\
\
install_name_tool -change \\\
  /System/Library/Frameworks/JavaScriptCore.framework/Versions/A/JavaScriptCore \\\
  @loader_path/../../../JavaScriptCore.framework/Versions/A/JavaScriptCore \\\
  ./WebKit/WebKitBuild/Release/WebKit.framework/Versions/A/WebKit\
\
install_name_tool -change \\\
  /System/Library/Frameworks/WebKit.framework/Versions/A/Frameworks/WebCore.framework/Versions/A/WebCore \\\
  @loader_path/../../../WebCore.framework/Versions/A/WebCore \\\
  ./WebKit/WebKitBuild/Release/WebKit.framework/Versions/A/WebKit\
\
\
echo "updating WebCore..."\
\
install_name_tool -id \\\
  @executable_path/../Frameworks/WebCore.framework/Versions/A/WebCore \\\
  ./WebKit/WebKitBuild/Release/WebCore.framework/Versions/A/WebCore\
\
install_name_tool -change \\\
  /System/Library/Frameworks/JavaScriptCore.framework/Versions/A/JavaScriptCore \\\
  @loader_path/../../../JavaScriptCore.framework/Versions/A/JavaScriptCore \\\
  ./WebKit/WebKitBuild/Release/WebCore.framework/Versions/A/WebCore\
\
echo "updating JavaScriptCore..."\
install_name_tool -id \\\
  @executable_path/../Frameworks/JavaScriptCore.framework/Versions/A/JavaScriptCore \\\
  ./WebKit/WebKitBuild/Release/JavaScriptCore.framework/Versions/A/JavaScriptCore\
\
}